<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
<!--     <link rel="shortcut icon" href="../../assets/ico/favicon.png"> -->

    <title>SGI</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap-3.1.1.css" rel="stylesheet" media="screen">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="../../assets/js/html5shiv.js"></script>
      <script src="../../assets/js/respond.min.js"></script>
    <![endif]-->

    
  </head>

  <body>
		<%@include file="header.jsp"%>
   
	 <div class="container"> 


		<p><strong>Mantenimiento de Ideas &gt; Buscar</strong></p>
		
		<form id="form1" name="form1" method="post" action="IdeaBuscarServlet" class="form-horizontal" role="form">
		  <p>Buscar: 
		    <label>
		    <input type="text" name="busqueda" id="busqueda" />
		    </label>
		    <label>
		    <input type="submit" name="button" id="button" value="Buscar" />
		    </label>
		    <label>
		    <input type="button" name="button2" id="button2" value="Nuevo" onclick="window.location='IdeaCrear.jsp' "  />
		    </label>
		    <br/>Estado:
			<label>
			<select name="txtEstadoIdea" id="txtEstadoIdea" required>
				<option value="Todas"  >Todas</option>
				<option value="publicada" >Publicada</option>
				<option value="aprobada" >Aprobada</option>
				<option value="rechazada" >Rechazada</option>
			</select>			
		    </label>
		  </p>
		</form>
		<div class="table-responsive">
		<table width="550" height="65" border="1" cellpadding="0" cellspacing="0" class="table table-hover">
		  <tr>
		    <th width="49" scope="col">Nro.</th>
		    <th width="180" scope="col">Titulo</th>
		    <th width="180" scope="col">Descripcion</th>
		    <th width="180" scope="col">Estado</th>
		    <th width="180" scope="col">Archivo</th>
		    <th width="180" scope="col">Fecha</th>
		    <th width="180" scope="col">Keywords</th>
		    <th width="180" scope="col">Autor</th>
		    <th width="180" scope="col">Acciones</th>
		  </tr>
		
		<%@page import="java.util.*, com.jnetwork.modelo.Idea" %>
		<%
		Collection<Idea> arreglo = (ArrayList<Idea>)request.getAttribute("Ideas");
		if(arreglo != null) { 
		int i = 1;
		for(Idea x : arreglo) {
		%>  
		  <tr>
		    <td><%=i++ %></td>
		    <td><% out.print(x.getTitulo()); %></td>
		    <td><% out.print(x.getDescripcion()); %></td>
		    <td><% out.print(x.getEstado()); %></td>
		    <td><% out.print(x.getArchivo()); %></td>
		    <td><% out.print(x.getFecha()); %></td>
		    <td><% out.print(x.getKey1()); %>,<% out.print(x.getKey2()); %>,<% out.print(x.getKey3()); %>,<% out.print(x.getKey4()); %></td>
			<td><% out.print(x.getEstudiante().getNombres()); %> <% out.print(x.getEstudiante().getApellidoPaterno()); %> <% out.print(x.getEstudiante().getApellidoMaterno()); %></td>
			<td><a href="<%=request.getContextPath() %>/IdeaModificarServlet?id=<%=x.getId() %>">Editar</a> - <a href="<%=request.getContextPath()%>
		/IdeaEliminarServlet?id=<%=x.getTitulo()%>" onclick="return confirm('¿Está seguro que desea eliminar');">Eliminar</a> - <a href="<%=request.getContextPath() %>/DiscucionBuscarServlet?id=<%=x.getId() %>">Discuciones</a> - <a href="<%=request.getContextPath() %>/IdeaEvaluarServlet?id=<%=x.getId() %>">Evaluar</a></td>
		  </tr>
		<% }  
		  } %>
		  
		</table>
		</div>

 		<!-- Site footer -->
	   <div class="footer">
	   	 <p>&nbsp;</p>
	     <p>&copy; Jnetwork 2014 </p>
	   </div>
	   
	 </div> <!-- /container -->
    
   


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    
     <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="js/jquery-1.10.2.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap-3.1.1.js"></script>
  </body>
</html>
